Skip to content

Conversation

@Huliiiiii
Copy link
Member

@Huliiiiii Huliiiiii commented Oct 28, 2025

Changes:

  • Generate ARRAY[ instead of ARRAY [ to match SQL conventions
  • Arrays now support null values

@Huliiiiii Huliiiiii requested review from Expurple and tyt2y3 October 28, 2025 17:46
@Huliiiiii
Copy link
Member Author

Still need to work on SeaORM to tweak the Enum design.

tyt2y3 added a commit that referenced this pull request Nov 8, 2025
## PR Info

- Closes #69

## New Features

- [ ] Provide a new type `RangeType` to implement Postgres range type
- [ ] Provide range type as an element type of Postgres Array

## Doubts

- [ ] Not sure where to implement `hashable-value` features. I put that
in the `with_range.rs`
- [ ] It implements time ranges with Chrono and Time I left out Jiff now
- [ ] Not sure how it plays together with `with-json`
- [ ] How to make RangeType from std Rust types (tuple, std range, how
to describe exclusive and inclusive bounds?)
- [ ] A refactor PR is going on which may affect this branch
(#1004)

---------

Co-authored-by: Chris Tsang <[email protected]>
Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. this is longer than I can dissect in one go, but looks good in general

}

// If bigdecimal is enabled and its size is larger, we make the limit to be bigdecimal's size
#[cfg(feature = "with-bigdecimal")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to disable bigdecimal by default in sea-orm

@Huliiiiii Huliiiiii force-pushed the value-array branch 2 times, most recently from e05f1c9 to 1fffd2a Compare December 17, 2025 11:11
@tyt2y3
Copy link
Member

tyt2y3 commented Dec 17, 2025

   --> src/backend/postgres.rs:394:1
    |
194 |             Value::Array(arr) => {
    |                                  - this delimiter might not be properly closed...
...
385 |                 }
    |                 - ...as it matches this but it has different indentation
...
394 | }

must be a problem with feature flags?

@Huliiiiii Huliiiiii requested a review from tyt2y3 December 17, 2025 14:25
@Huliiiiii
Copy link
Member Author

@Expurple Which do you prefer? Arrry::Type(Option(...)) or Array::Null(ArrayType)

@tyt2y3
Copy link
Member

tyt2y3 commented Dec 17, 2025

I'd say Array::Null(ArrayType) is slightly easier to use, but most users wont construct these directly anyway

#[derive(Debug, Clone)]
#[cfg_attr(not(feature = "hashable-value"), derive(PartialEq))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't have to be non_exhaustive I guess?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value is non_exhaustive, so this should also be non_exhaustive.

@tyt2y3 tyt2y3 merged commit b649b04 into SeaQL:master Dec 19, 2025
9 checks passed
@Huliiiiii Huliiiiii deleted the value-array branch December 19, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants